package com.bdqn.printer;

import java.awt.*;

/**
 * GreyInk 灰白墨盒
 *
 * @author LILIBO
 * @since 2021-12-07
 */
public class GreyInk implements Ink {

    /**
     * 配置颜色的方法
     *
     * @param red
     * @param green
     * @param blue
     * @return 返回打印采用的颜色
     */
    @Override
    public String getColor(int red, int green, int blue) {
        int c = (red + green + blue) / 3;
        Color color = new Color(c, c, c);
        return "#" + Integer.toHexString(color.getRGB()).substring(2);
    }
}
